package com.demo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
public class HelloController {

    @Autowired
    private UserServiceImpl userService;

    /**
     * @param condition
     * @param page
     * @param size
     * @return
     */
    @GetMapping("rsql")
    public Object query(@RequestParam String condition,
                        @RequestParam(required = false, defaultValue = "0") int page,
                        @RequestParam(required = false, defaultValue = "20") int size) {
        userService.test(condition);
        return null;
    }
    @GetMapping("name")
    public Object query(@RequestBody User user) {
        System.out.println(user);
        return null;
    }


    @RequestMapping("hello")
    public String hello() {
        return "hello";
    }
    @RequestMapping("test")
    public String test() {
        return "test";
    }
}